const express = require('express')
const router = express.Router()
const { readBannerList } = require('../../model/mongo')

router.get('/list', async (req, res) => {
    const result = {
        code: 200,
        method: req.method,
        msg: '获取轮播图数据成功',
        data: []
    }
    result.data = await readBannerList()
    result.data = result.data.slice(0, 4)
    res.send(JSON.stringify(result))
})

module.exports = router
